Skip to content

Add field-level validation for LinearLayout dimension inputs#14

Merged
leeliu103 merged 1 commit intomainfrom
add-linear-layout-validation
Dec 5, 2025
Merged

Add field-level validation for LinearLayout dimension inputs#14
leeliu103 merged 1 commit intomainfrom
add-linear-layout-validation

Conversation

@leeliu103
Copy link
Owner

Implements real-time validation with visual feedback for LinearLayout tab:

  • Name validation: must be non-empty after trimming
  • Size validation: must be power of 2 and >= 2
  • Red border highlighting on invalid fields
  • Inline error messages below each field
  • Warning-style status message for overall validation state

Creates LinearLayoutValidator following InputValidator pattern:

  • Extracted validation logic to src/validation/LinearLayoutValidator.ts
  • Added comprehensive unit tests (7 tests covering all validation rules)
  • Proper dependency flow: validator owns types, tab imports them

UI improvements:

  • Added .input-error CSS class for invalid field styling
  • Added .layout-status CSS class matching validation-warnings style
  • Prevents matrix updates when validation fails

Core library unchanged:

  • Validation enforced only at UI layer (LinearLayoutTab)
  • Core LinearLayout.ts supports all valid cases including size=1
  • Added regression test for degenerate (size=1) dimension handling
  • BlockLayout, MFMALayout, WMMALayout unaffected

🤖 Generated with Claude Code

Implements real-time validation with visual feedback for LinearLayout tab:
- Name validation: must be non-empty after trimming
- Size validation: must be power of 2 and >= 2
- Red border highlighting on invalid fields
- Inline error messages below each field
- Warning-style status message for overall validation state

Creates LinearLayoutValidator following InputValidator pattern:
- Extracted validation logic to src/validation/LinearLayoutValidator.ts
- Added comprehensive unit tests (7 tests covering all validation rules)
- Proper dependency flow: validator owns types, tab imports them

UI improvements:
- Added .input-error CSS class for invalid field styling
- Added .layout-status CSS class matching validation-warnings style
- Prevents matrix updates when validation fails

Core library unchanged:
- Validation enforced only at UI layer (LinearLayoutTab)
- Core LinearLayout.ts supports all valid cases including size=1
- Added regression test for degenerate (size=1) dimension handling
- BlockLayout, MFMALayout, WMMALayout unaffected

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@leeliu103 leeliu103 merged commit ce8187e into main Dec 5, 2025
1 check passed
@leeliu103 leeliu103 deleted the add-linear-layout-validation branch December 5, 2025 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant